﻿using System;
using System.Collections.Generic;
using System.Web;
using OneMG.Phoenix.Kernel.Helper;

namespace OneMG.Phoenix.AdminSite
{

    public class Upload : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            HttpPostedFile jpeg_image_upload = context.Request.Files["Filedata"];

            string path= ImageHelper.UploadFile(jpeg_image_upload, "/Upload/");

            string thumpath = ImageHelper.ToThumImages(path, 100, 100);

            context.Response.StatusCode = 200;
            context.Response.Write("" + path + "");


        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}
